﻿@using PAMD
@using PAMD.Business.Models
@model PAMD.Business.Models.ListingModel
@{
    ViewBag.Title = SiteConstant.Slogan;
    Layout = "../Shared/_Layout.cshtml";
}
@Scripts.Render("~/js/Views/ListingView.js")
<script language="javascript" type="text/javascript">

    $(document).ready(function (event) {

        $('#Edit').button();

    });

</script>
@using (Html.BeginForm("Edit", "Listing", new { @id = Model.Listing.ID }))
{
    <div class="form-container-small">
        <strong>Parking space summary</strong>
        <fieldset class="field-container">
            <div>
                @if (ViewBag.Error != null && ViewBag.Error != "")
                {
                    <div class="red-box">
                        @ViewBag.Error
                    </div>
                }
                <!--  ========================== About parking space header ==========================   -->
                <div class="left-align">
                    <div class="controlBox">
                        <h6>
                            About parking space</h6>
                    </div>
                </div>
                <div class="left-align line-divider-lightblue">
                    &nbsp;
                </div>
                <!--  ========================== Title ==========================   -->
                <div class="left-align">
                    <div class="controlBox">
                        Title: @Model.Listing.Title
                    </div>
                </div>
                <!--  ==========================  Space category ==========================   -->
                <div class="left-align">
                    <div class="controlBox">
                        Space category: @Model.Listing.SpaceCategory
                        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                        @if (Model.Listing.IsPrivate)
                        {
                            @:This is private drive.
                            }
                        else
                        {
                            @:This is not private drive.
                                                                            }
                    </div>
                </div>
                <!--  ==========================  Vehicle capacity ==========================   -->
                <div class="left-align">
                    <div class="controlBox">
                        Vehicle capacity: @Model.Listing.NumberOfSpace
                    </div>
                </div>
                <!--  ==========================  Rental period ==========================   -->
                <div class="left-align">
                    <div class="controlBox">
                        Rental period: @PAMD.Extension.Utility.GetRentalPeriodString(Model.Listing)
                    </div>
                </div>
                <!--  ==========================  Minimum rental period ==========================   -->
                <div class="left-align">
                    <div class="controlBox">
                        Minimum rental period: @Model.Listing.MinRentalPeriod &nbsp; @Model.Listing.MinRentalPeriodUnit</div>
                </div>
                <!--  ========================== Pricing details ==========================   -->
                <div class="left-align">
                    <div class="controlBox">
                        <h6>
                            Pricing details</h6>
                    </div>
                </div>
                <div class="left-align line-divider-lightblue">
                    &nbsp;
                </div>
                <!--  ==========================  Minimum Deposit * £ ==========================   -->
                <div class="left-align">
                    <div class="controlBox">
                        Minimum deposit: £ @Model.Listing.Deposit
                    </div>
                </div>
                <!--  ==========================  Add prices * £ ============================   -->
                <div class="left-align">
                    <div class="controlBox">
                        <div id="PriceList" style="margin-left: 130px;">
                            &nbsp;
                        </div>
                    </div>
                </div>
                <!--  ========================== Address details ==========================   -->
                <div class="left-align">
                    <div class="controlBox">
                        <h6>
                            Address details</h6>
                    </div>
                </div>
                <div class="left-align line-divider-lightblue">
                    &nbsp;
                </div>
                <!--  ==========================  Address         ==========================   -->
                <div class="left-align">
                    <div class="controlBox">
                        <div class="smallLabel">
                            Address :&nbsp;</div>
                        <div class="left-align">
                            @if (Model.Address == null)
                            {
                                @Html.ActionLink("Add", "Edit", "Listing", new { @id = Model.Listing.ID }, null)
                            }
                            else
                            {
                                var address = Model.Address;
                                @address.Line1<br />
                                @address.Line2<br />
                                @address.City <br />
                                @address.County<br />
                                @address.PostCode<br />
                                if (!string.IsNullOrEmpty(address.Country))
                                {
                                @address.Country;
                                }
                            }</div>
                    </div>
                </div>
                <div class="left-align">
                    <div class="controlBox">
                        <img id="imgMap" class="roundimage" alt="Location" style="margin-left: 170px; border-bottom-color: White;" />
                    </div>
                </div>
                <!--  ========================== Contact details ==========================   -->
                <div class="left-align">
                    <div class="controlBox">
                        <h6>
                            Contact details</h6>
                    </div>
                </div>
                <div class="left-align line-divider-lightblue">
                    &nbsp;
                </div>
                <!--  ==========================  Mobile         ==========================   -->
                <div class="left-align">
                    <div class="controlBox">
                        Mobile: @Model.Listing.ContactNumber
                    </div>
                </div>
                <!--  ========================== Space description ==========================   -->
                <div class="left-align">
                    <div class="controlBox">
                        <h6>
                            Space description</h6>
                    </div>
                </div>
                <div class="left-align line-divider-lightblue">
                    &nbsp;
                </div>
                <!--  ==========================  Space details         ==========================   -->
                <div class="left-align">
                    <div class="controlBox">
                        Tell more: @Model.Listing.SpaceDescription
                    </div>
                </div>
                <!--  ========================== Upload pictures title ==========================   -->
                <div class="left-align">
                    <div class="controlBox">
                        <h6>
                            Listing photoes</h6>
                    </div>
                </div>
                <div class="left-align line-divider-lightblue">
                    &nbsp;
                </div>
                <!--  ==========================  Upload pictures         ==========================   -->
                <div class="left-align">
                    <div class="controlBox">
                        <div id="fileResult" style="max-height: 150px; overflow: auto;">
                            &nbsp;</div>
                    </div>
                </div>
                <div class="left-align">
                    &nbsp;
                </div>
                <div class="left-align">
                    <label for="">
                        &nbsp;
                    </label>
                    <input type="submit" id="Edit" style="margin-left: 100px;" value="Update" />
                    @Html.HiddenFor(m => m.PriceListFinal)
                    @Html.HiddenFor(m => m.FileList)
                    @Html.HiddenFor(m => m.Address.PostCode)
                </div>
            </div>
        </fieldset>
    </div>
}